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

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: D = None
        self.o: C = None
        self.t: D = None
        self.x: C = None
        self.w: A = None
        self.z: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: E = None
        self.z: F = None
        self.r: F = None
        self.s: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: D = None
        self.o: C = None
        self.t: D = None
        self.x: C = None
        self.w: A = None
        self.z: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: E = None
        self.z: F = None
        self.r: F = None
        self.s: B = None
        self.txt = txt

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

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

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