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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: E = None
        self.p: F = None
        self.o: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: E = None
        self.w: D = None
        self.r: F = None
        self.s: F = None
        self.q: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: A = None
        self.q: E = None
        self.x: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.z: D = None
        self.t: C = None
        self.p: E = None
        self.v: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: E = None
        self.w: G = None
        self.p: A = None
        self.y: A = None
        self.s: G = None
        self.r: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: E = None
        self.p: F = None
        self.o: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: E = None
        self.w: D = None
        self.r: F = None
        self.s: F = None
        self.q: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: A = None
        self.q: E = None
        self.x: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.z: D = None
        self.t: C = None
        self.p: E = None
        self.v: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: E = None
        self.w: G = None
        self.p: A = None
        self.y: A = None
        self.s: G = None
        self.r: A = None
        self.txt = txt

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

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