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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: E = None
        self.u: B = None
        self.p: B = None
        self.q: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.v: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: G = None
        self.z: F = None
        self.r: D = None
        self.u: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: G = None
        self.t: E = None
        self.z: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

b = A("b")
m = B("m")
n = C("n")
d = D("d")
e = E("e")
j = F("j")
l = G("l")

b.p = j
b.r = j
b.x = n
b.w = n
b.v = l
b.t = m
b.z = e
m.s = j
n.w = m
n.u = m
n.p = m
n.v = e
n.q = e
d.w = l
d.v = j
e.q = l
e.x = l
e.z = j
e.r = d
e.u = n
j.o = e
j.t = e
j.p = l
j.z = l
l.u = d
assert m.s.t.z.t.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.x: C = None
        self.v: G = None
        self.t: B = None
        self.z: E = None
        self.w: C = None
        self.r: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: E = None
        self.u: B = None
        self.p: B = None
        self.q: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.v: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: G = None
        self.z: F = None
        self.r: D = None
        self.u: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: G = None
        self.t: E = None
        self.z: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

b = A("b")
m = B("m")
n = C("n")
d = D("d")
e = E("e")
j = F("j")
l = G("l")

b.p = j
b.r = j
b.x = n
b.w = n
b.v = l
b.t = m
b.z = e
m.s = j
n.w = m
n.u = m
n.p = m
n.v = e
n.q = e
d.w = l
d.v = j
e.q = l
e.x = l
e.z = j
e.r = d
e.u = n
j.o = e
j.t = e
j.p = l
j.z = l
l.u = d
assert m.s.t.z.t.u.u.txt == "m"