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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.y: F = None
        self.z: D = None
        self.q: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: E = None
        self.r: B = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: D = None
        self.txt = txt

i = A("i")
g = B("g")
b = C("b")
m = D("m")
j = E("j")
a = F("a")
f = G("f")
c = H("c")
k = G("k")

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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.y: F = None
        self.z: D = None
        self.q: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: E = None
        self.r: B = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: D = None
        self.txt = txt

i = A("i")
g = B("g")
b = C("b")
m = D("m")
j = E("j")
a = F("a")
f = G("f")
c = H("c")
k = G("k")

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