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

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

class C:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: A = None
        self.p: E = None
        self.v: E = None
        self.t: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: A = None
        self.u: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: H = None
        self.x: A = None
        self.w: D = None
        self.r: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: A = None
        self.p: E = None
        self.v: E = None
        self.t: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: A = None
        self.u: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: H = None
        self.x: A = None
        self.w: D = None
        self.r: B = None
        self.txt = txt

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

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

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