class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: H = None
        self.o: C = None
        self.t: G = None
        self.z: F = None
        self.q: H = None
        self.y: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: B = None
        self.s: B = None
        self.q: G = None
        self.u: E = None
        self.v: E = None
        self.w: E = None
        self.z: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: D = None
        self.p: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: B = None
        self.s: B = None
        self.q: G = None
        self.u: E = None
        self.v: E = None
        self.w: E = None
        self.z: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: D = None
        self.p: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

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

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