class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.w: B = None
        self.t: F = None
        self.u: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.o: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: G = None
        self.v: B = None
        self.w: C = None
        self.r: G = None
        self.z: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: D = None
        self.t: C = None
        self.u: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.v: C = None
        self.p: A = None
        self.x: F = None
        self.s: F = None
        self.q: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.o: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: G = None
        self.v: B = None
        self.w: C = None
        self.r: G = None
        self.z: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: D = None
        self.t: C = None
        self.u: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.v: C = None
        self.p: A = None
        self.x: F = None
        self.s: F = None
        self.q: C = None
        self.txt = txt

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

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