class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: F = None
        self.z: G = None
        self.t: F = None
        self.v: F = None
        self.u: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.y: C = None
        self.v: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: A = None
        self.x: F = None
        self.s: C = None
        self.o: F = None
        self.r: A = None
        self.u: D = None
        self.txt = txt

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

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

a = A("a")
i = B("i")
h = C("h")
l = D("l")
c = E("c")
f = F("f")
m = G("m")
j = F("j")

a.p = h
a.y = f
a.z = m
a.u = m
a.t = j
a.v = j
i.z = m
i.y = h
i.v = a
h.z = i
l.o = j
l.t = f
l.p = h
c.v = l
c.u = l
c.q = a
c.r = a
c.x = f
c.s = h
c.o = j
f.w = m
f.z = a
f.x = i
f.p = i
f.y = c
m.y = a
m.o = h
m.v = l
j.w = m
j.z = a
j.x = i
j.p = i
j.y = c
assert l.t.w.v.t.x.z.y.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: F = None
        self.z: G = None
        self.t: F = None
        self.v: F = None
        self.u: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.y: C = None
        self.v: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: A = None
        self.x: F = None
        self.s: C = None
        self.o: F = None
        self.r: A = None
        self.u: D = None
        self.txt = txt

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

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

a = A("a")
i = B("i")
h = C("h")
l = D("l")
c = E("c")
f = F("f")
m = G("m")
j = F("j")

a.p = h
a.y = f
a.z = m
a.u = m
a.t = j
a.v = j
i.z = m
i.y = h
i.v = a
h.z = i
l.o = j
l.t = f
l.p = h
c.v = l
c.u = l
c.q = a
c.r = a
c.x = f
c.s = h
c.o = j
f.w = m
f.z = a
f.x = i
f.p = i
f.y = c
m.y = a
m.o = h
m.v = l
j.w = m
j.z = a
j.x = i
j.p = i
j.y = c
assert l.t.w.v.t.x.z.y.p.txt == "h"