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

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

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.r: B = None
        self.v: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: C = None
        self.y: D = None
        self.s: D = None
        self.w: D = None
        self.txt = txt

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

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

i.p = f
g.y = h
d.p = l
d.v = g
d.w = h
d.u = i
d.t = i
d.r = f
a.z = i
a.r = g
a.v = g
h.x = f
h.t = f
h.y = a
h.s = a
h.w = a
l.w = e
l.t = g
f.p = e
f.v = g
f.w = h
f.u = i
f.t = i
f.r = d
e.w = l
e.t = g
assert e.t.y.y.z.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.r: B = None
        self.v: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: C = None
        self.y: D = None
        self.s: D = None
        self.w: D = None
        self.txt = txt

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

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

i.p = f
g.y = h
d.p = l
d.v = g
d.w = h
d.u = i
d.t = i
d.r = f
a.z = i
a.r = g
a.v = g
h.x = f
h.t = f
h.y = a
h.s = a
h.w = a
l.w = e
l.t = g
f.p = e
f.v = g
f.w = h
f.u = i
f.t = i
f.r = d
e.w = l
e.t = g
assert e.t.y.y.z.p.txt == "f"