class A:
    def __init__(self, txt: str):
        self.t: G = None
        self.z: B = None
        self.o: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: D = None
        self.z: F = None
        self.t: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: D = None
        self.z: F = None
        self.t: C = None
        self.txt = txt

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

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