class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: C = None
        self.x: A = None
        self.r: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: E = None
        self.o: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: E = None
        self.x: A = None
        self.o: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: F = None
        self.q: F = None
        self.u: E = None
        self.o: A = None
        self.p: F = None
        self.txt = txt

m = A("m")
i = B("i")
e = C("e")
b = D("b")
g = E("g")
f = F("f")
j = G("j")

m.u = b
m.p = f
i.t = g
i.r = g
i.z = e
i.x = m
e.y = b
e.t = i
b.z = i
b.v = g
b.o = m
g.r = i
g.t = e
f.v = e
f.y = g
f.x = m
f.o = b
j.s = i
j.v = f
j.q = f
j.p = f
j.u = g
j.o = m
assert e.t.z.t.t.r.x.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: C = None
        self.x: A = None
        self.r: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: E = None
        self.o: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: E = None
        self.x: A = None
        self.o: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: F = None
        self.q: F = None
        self.u: E = None
        self.o: A = None
        self.p: F = None
        self.txt = txt

m = A("m")
i = B("i")
e = C("e")
b = D("b")
g = E("g")
f = F("f")
j = G("j")

m.u = b
m.p = f
i.t = g
i.r = g
i.z = e
i.x = m
e.y = b
e.t = i
b.z = i
b.v = g
b.o = m
g.r = i
g.t = e
f.v = e
f.y = g
f.x = m
f.o = b
j.s = i
j.v = f
j.q = f
j.p = f
j.u = g
j.o = m
assert e.t.z.t.t.r.x.txt == "m"