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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: E = None
        self.o: H = None
        self.p: A = None
        self.s: H = None
        self.z: H = None
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: H = None
        self.r: C = None
        self.w: A = None
        self.v: D = None
        self.u: B = 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.v: A = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: E = None
        self.o: H = None
        self.p: A = None
        self.s: H = None
        self.z: H = None
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: H = None
        self.r: C = None
        self.w: A = None
        self.v: D = None
        self.u: B = 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.v: A = None
        self.txt = txt

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

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