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

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: A = None
        self.o: D = None
        self.x: C = None
        self.u: D = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: B = None
        self.w: F = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: A = None
        self.o: D = None
        self.x: C = None
        self.u: D = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: B = None
        self.w: F = None
        self.txt = txt

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

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

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

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

n.t = f
n.z = g
n.y = j
n.u = d
g.t = n
g.q = n
g.o = e
g.u = e
g.x = d
g.s = d
d.t = j
d.w = j
d.v = g
e.o = d
f.s = g
f.t = n
j.t = g
assert e.o.t.t.t.u.txt == "d"