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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.q: C = None
        self.z: C = None
        self.o: A = None
        self.t: C = None
        self.u: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.r: A = None
        self.q: F = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.q: C = None
        self.z: C = None
        self.o: A = None
        self.t: C = None
        self.u: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.r: A = None
        self.q: F = None
        self.txt = txt

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

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

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

h.p = f
d.v = f
d.q = g
d.z = g
d.t = g
d.o = h
d.u = k
g.y = n
g.v = j
g.p = h
g.o = f
n.p = j
n.r = h
n.q = e
j.w = n
f.t = l
k.p = l
k.r = h
k.q = e
e.t = j
l.w = n
assert g.v.w.q.t.w.q.txt == "e"