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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.q: G = None
        self.v: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

m = A("m")
n = B("n")
c = C("c")
b = D("b")
i = E("i")
f = F("f")
g = G("g")
l = G("l")
h = D("h")

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.q: G = None
        self.v: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

m = A("m")
n = B("n")
c = C("c")
b = D("b")
i = E("i")
f = F("f")
g = G("g")
l = G("l")
h = D("h")

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