class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: A = None
        self.v: F = None
        self.t: A = None
        self.txt = txt

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

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

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

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

f = A("f")
l = B("l")
c = C("c")
h = D("h")
b = E("b")
d = F("d")
j = E("j")
i = A("i")
k = A("k")
m = C("m")

f.p = m
l.w = d
l.v = d
l.p = f
l.t = i
c.z = i
c.y = h
c.u = l
c.t = b
c.p = b
c.s = j
h.u = m
h.y = c
h.r = d
b.p = j
b.x = i
b.v = h
d.p = l
d.q = b
d.t = b
j.p = b
j.x = i
j.v = h
i.p = m
k.p = c
m.z = i
m.y = h
m.u = l
m.t = j
m.p = b
m.s = b
assert h.u.t.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: A = None
        self.v: F = None
        self.t: A = None
        self.txt = txt

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

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

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

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

f = A("f")
l = B("l")
c = C("c")
h = D("h")
b = E("b")
d = F("d")
j = E("j")
i = A("i")
k = A("k")
m = C("m")

f.p = m
l.w = d
l.v = d
l.p = f
l.t = i
c.z = i
c.y = h
c.u = l
c.t = b
c.p = b
c.s = j
h.u = m
h.y = c
h.r = d
b.p = j
b.x = i
b.v = h
d.p = l
d.q = b
d.t = b
j.p = b
j.x = i
j.v = h
i.p = m
k.p = c
m.z = i
m.y = h
m.u = l
m.t = j
m.p = b
m.s = b
assert h.u.t.p.txt == "b"