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

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

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

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

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

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

j = A("j")
c = B("c")
a = C("a")
h = D("h")
l = E("l")
m = F("m")
b = B("b")
e = C("e")

j.z = l
j.y = l
j.p = h
c.u = j
c.s = h
c.o = h
a.t = j
a.x = m
a.r = m
a.v = e
h.t = m
h.s = a
h.w = j
l.x = j
l.y = e
m.v = l
m.z = l
b.u = j
b.s = h
b.o = h
e.t = j
e.x = m
e.r = m
e.v = a
assert j.y.x.p.t.v.x.p.t.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: E = None
        self.p: D = None
        self.txt = txt

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

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

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

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

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

j = A("j")
c = B("c")
a = C("a")
h = D("h")
l = E("l")
m = F("m")
b = B("b")
e = C("e")

j.z = l
j.y = l
j.p = h
c.u = j
c.s = h
c.o = h
a.t = j
a.x = m
a.r = m
a.v = e
h.t = m
h.s = a
h.w = j
l.x = j
l.y = e
m.v = l
m.z = l
b.u = j
b.s = h
b.o = h
e.t = j
e.x = m
e.r = m
e.v = a
assert j.y.x.p.t.v.x.p.t.txt == "m"