class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: C = None
        self.t: A = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: C = None
        self.t: A = None
        self.txt = txt

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

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