class A:
    def __init__(self, txt: str):
        self.w: G = None
        self.o: G = None
        self.s: F = None
        self.x: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: H = None
        self.r: F = None
        self.x: G = None
        self.w: A = None
        self.txt = txt

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

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: H = None
        self.r: F = None
        self.x: G = None
        self.w: A = None
        self.txt = txt

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

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

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

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

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