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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.w: D = None
        self.p: B = None
        self.y: C = None
        self.o: D = None
        self.txt = txt

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

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

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

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

f = A("f")
b = B("b")
h = C("h")
d = D("d")
l = E("l")
g = F("g")
c = B("c")
k = D("k")
n = E("n")
e = D("e")

f.y = h
f.t = k
f.v = g
b.x = n
b.w = k
b.p = c
b.y = h
b.o = d
h.w = k
h.x = k
h.y = d
h.p = e
d.z = g
l.t = f
l.p = b
l.v = c
l.r = n
l.o = e
g.r = h
c.x = l
c.w = e
c.p = b
c.y = h
c.o = d
k.z = g
n.t = f
n.p = b
n.v = b
n.r = l
n.o = d
e.z = g
assert k.z.r.w.z.r.p.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: D = None
        self.v: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.w: D = None
        self.p: B = None
        self.y: C = None
        self.o: D = None
        self.txt = txt

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

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

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

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

f = A("f")
b = B("b")
h = C("h")
d = D("d")
l = E("l")
g = F("g")
c = B("c")
k = D("k")
n = E("n")
e = D("e")

f.y = h
f.t = k
f.v = g
b.x = n
b.w = k
b.p = c
b.y = h
b.o = d
h.w = k
h.x = k
h.y = d
h.p = e
d.z = g
l.t = f
l.p = b
l.v = c
l.r = n
l.o = e
g.r = h
c.x = l
c.w = e
c.p = b
c.y = h
c.o = d
k.z = g
n.t = f
n.p = b
n.v = b
n.r = l
n.o = d
e.z = g
assert k.z.r.w.z.r.p.txt == "e"