class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: F = None
        self.y: D = None
        self.s: D = None
        self.t: C = None
        self.z: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: F = None
        self.p: B = None
        self.o: C = None
        self.u: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.x: E = None
        self.y: E = None
        self.txt = txt

n = A("n")
b = B("b")
j = C("j")
l = D("l")
c = E("c")
g = F("g")

n.r = l
n.y = l
n.s = l
n.u = g
n.t = j
n.z = b
b.y = c
b.v = g
b.z = l
j.z = g
l.t = b
c.y = g
c.s = g
c.p = b
c.o = j
c.u = l
g.q = j
g.x = c
g.y = c
assert g.y.o.z.q.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: F = None
        self.y: D = None
        self.s: D = None
        self.t: C = None
        self.z: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: F = None
        self.p: B = None
        self.o: C = None
        self.u: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.x: E = None
        self.y: E = None
        self.txt = txt

n = A("n")
b = B("b")
j = C("j")
l = D("l")
c = E("c")
g = F("g")

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