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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: B = None
        self.q: B = None
        self.p: B = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: B = None
        self.q: B = None
        self.p: B = None
        self.txt = txt

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

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

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