class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: F = None
        self.y: B = None
        self.r: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

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

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

j = A("j")
a = B("a")
d = C("d")
m = D("m")
l = E("l")
k = F("k")
b = B("b")
e = D("e")
i = E("i")

j.v = k
j.u = k
j.y = a
j.r = i
a.u = i
d.y = a
m.z = j
m.s = d
l.p = j
l.q = k
l.z = m
l.t = i
l.r = a
k.v = l
k.z = l
k.t = e
k.p = i
b.u = i
e.z = j
e.s = d
i.p = j
i.q = k
i.z = m
i.t = l
i.r = b
assert a.u.t.q.t.s.y.u.p.txt == "
class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: F = None
        self.y: B = None
        self.r: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

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

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

j = A("j")
a = B("a")
d = C("d")
m = D("m")
l = E("l")
k = F("k")
b = B("b")
e = D("e")
i = E("i")

j.v = k
j.u = k
j.y = a
j.r = i
a.u = i
d.y = a
m.z = j
m.s = d
l.p = j
l.q = k
l.z = m
l.t = i
l.r = a
k.v = l
k.z = l
k.t = e
k.p = i
b.u = i
e.z = j
e.s = d
i.p = j
i.q = k
i.z = m
i.t = l
i.r = b
assert a.u.t.q.t.s.y.u.p.txt == "j"