class A:
    def __init__(self, txt: str):
        self.q: G = None
        self.w: H = None
        self.r: C = None
        self.x: I = None
        self.p: G = None
        self.s: F = None
        self.o: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: F = None
        self.v: I = None
        self.u: G = None
        self.t: E = None
        self.y: D = None
        self.x: D = None
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.w: F = None
        self.x: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.s: A = None
        self.q: H = None
        self.u: E = None
        self.w: H = None
        self.x: H = None
        self.v: D = None
        self.p: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: B = None
        self.w: I = None
        self.o: E = None
        self.q: C = None
        self.t: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: H = None
        self.v: B = None
        self.x: B = None
        self.r: D = None
        self.t: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: F = None
        self.v: I = None
        self.u: G = None
        self.t: E = None
        self.y: D = None
        self.x: D = None
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.w: F = None
        self.x: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.s: A = None
        self.q: H = None
        self.u: E = None
        self.w: H = None
        self.x: H = None
        self.v: D = None
        self.p: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: B = None
        self.w: I = None
        self.o: E = None
        self.q: C = None
        self.t: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: H = None
        self.v: B = None
        self.x: B = None
        self.r: D = None
        self.t: E = None
        self.txt = txt

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

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