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

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.t: G = None
        self.v: D = None
        self.r: B = None
        self.w: B = None
        self.y: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.y: G = None
        self.r: F = None
        self.p: E = None
        self.o: B = None
        self.s: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.p: D = None
        self.r: B = None
        self.y: F = None
        self.z: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.z: C = None
        self.x: A = None
        self.t: A = None
        self.s: D = None
        self.v: D = None
        self.r: D = None
        self.q: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: A = None
        self.o: F = None
        self.q: A = None
        self.w: E = None
        self.y: H = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.t: G = None
        self.v: D = None
        self.r: B = None
        self.w: B = None
        self.y: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.y: G = None
        self.r: F = None
        self.p: E = None
        self.o: B = None
        self.s: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.p: D = None
        self.r: B = None
        self.y: F = None
        self.z: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.z: C = None
        self.x: A = None
        self.t: A = None
        self.s: D = None
        self.v: D = None
        self.r: D = None
        self.q: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: A = None
        self.o: F = None
        self.q: A = None
        self.w: E = None
        self.y: H = None
        self.txt = txt

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

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

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