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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: A = None
        self.x: A = None
        self.r: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

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

j = A("j")
b = B("b")
e = C("e")
d = D("d")
g = E("g")
n = F("n")

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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: A = None
        self.x: A = None
        self.r: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

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

j = A("j")
b = B("b")
e = C("e")
d = D("d")
g = E("g")
n = F("n")

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