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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: A = None
        self.r: C = None
        self.z: E = None
        self.q: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.z: F = None
        self.r: A = None
        self.x: F = None
        self.w: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: A = None
        self.r: C = None
        self.z: E = None
        self.q: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.z: F = None
        self.r: A = None
        self.x: F = None
        self.w: D = None
        self.txt = txt

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

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

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