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

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

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

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.u: A = None
        self.q: A = None
        self.p: E = None
        self.x: H = None
        self.r: A = None
        self.o: D = None
        self.y: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.y: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: E = None
        self.w: F = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.u: A = None
        self.q: A = None
        self.p: E = None
        self.x: H = None
        self.r: A = None
        self.o: D = None
        self.y: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.y: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: E = None
        self.w: F = None
        self.txt = txt

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

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