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

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

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.x: A = None
        self.o: E = None
        self.q: G = None
        self.p: G = None
        self.v: G = None
        self.z: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: E = None
        self.q: F = None
        self.s: G = None
        self.p: E = None
        self.z: D = None
        self.o: D = None
        self.txt = txt

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

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

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

k.o = l
h.t = k
h.w = g
h.s = l
h.p = l
l.t = g
l.z = g
l.x = k
l.o = c
l.q = b
l.p = b
l.v = b
f.q = l
f.z = g
e.w = f
e.z = f
e.o = f
e.x = c
e.p = c
e.q = m
e.s = b
m.x = h
m.p = h
b.s = f
b.v = k
b.t = l
c.w = f
c.z = f
c.o = f
c.x = e
c.p = e
c.q = g
c.s = b
g.x = h
g.p = h
assert g.x.w.x.w.x.t.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.x: A = None
        self.o: E = None
        self.q: G = None
        self.p: G = None
        self.v: G = None
        self.z: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: E = None
        self.q: F = None
        self.s: G = None
        self.p: E = None
        self.z: D = None
        self.o: D = None
        self.txt = txt

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

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

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

k.o = l
h.t = k
h.w = g
h.s = l
h.p = l
l.t = g
l.z = g
l.x = k
l.o = c
l.q = b
l.p = b
l.v = b
f.q = l
f.z = g
e.w = f
e.z = f
e.o = f
e.x = c
e.p = c
e.q = m
e.s = b
m.x = h
m.p = h
b.s = f
b.v = k
b.t = l
c.w = f
c.z = f
c.o = f
c.x = e
c.p = e
c.q = g
c.s = b
g.x = h
g.p = h
assert g.x.w.x.w.x.t.o.txt == "l"