class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: G = None
        self.p: F = None
        self.z: E = None
        self.v: C = None
        self.t: F = None
        self.r: H = None
        self.u: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.v: E = None
        self.x: C = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: C = None
        self.w: D = None
        self.z: H = None
        self.s: F = None
        self.y: B = None
        self.u: A = None
        self.x: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.v: E = None
        self.x: C = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: C = None
        self.w: D = None
        self.z: H = None
        self.s: F = None
        self.y: B = None
        self.u: A = None
        self.x: B = None
        self.txt = txt

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

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