class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: E = None
        self.w: B = None
        self.x: F = None
        self.o: B = None
        self.y: H = None
        self.v: I = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: F = None
        self.t: F = None
        self.q: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: I = None
        self.v: C = None
        self.x: E = None
        self.y: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: H = None
        self.p: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: A = None
        self.q: D = None
        self.o: B = None
        self.z: I = None
        self.r: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: D = None
        self.y: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: F = None
        self.t: F = None
        self.q: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: I = None
        self.v: C = None
        self.x: E = None
        self.y: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: H = None
        self.p: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: A = None
        self.q: D = None
        self.o: B = None
        self.z: I = None
        self.r: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: D = None
        self.y: B = None
        self.txt = txt

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

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

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