class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: E = None
        self.w: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: G = None
        self.r: B = None
        self.z: D = None
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: E = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: G = None
        self.z: G = None
        self.w: A = None
        self.txt = txt

i = A("i")
j = B("j")
c = C("c")
l = D("l")
d = E("d")
k = F("k")
n = G("n")
f = E("f")
m = G("m")
h = B("h")

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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: G = None
        self.r: B = None
        self.z: D = None
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: E = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: G = None
        self.z: G = None
        self.w: A = None
        self.txt = txt

i = A("i")
j = B("j")
c = C("c")
l = D("l")
d = E("d")
k = F("k")
n = G("n")
f = E("f")
m = G("m")
h = B("h")

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