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

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

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

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

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

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

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

j.x = l
j.p = k
j.r = g
d.p = j
d.z = g
d.q = e
a.s = j
a.x = d
g.t = d
g.p = a
g.o = l
g.v = e
f.s = j
l.o = e
l.p = e
l.z = j
l.y = g
k.s = j
e.o = l
e.p = l
e.z = j
e.y = g
assert e.y.t.q.y.v.y.txt == "
class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: E = None
        self.r: D = None
        self.txt = txt

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

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

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

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

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

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

j.x = l
j.p = k
j.r = g
d.p = j
d.z = g
d.q = e
a.s = j
a.x = d
g.t = d
g.p = a
g.o = l
g.v = e
f.s = j
l.o = e
l.p = e
l.z = j
l.y = g
k.s = j
e.o = l
e.p = l
e.z = j
e.y = g
assert e.y.t.q.y.v.y.txt == "g"