class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.p: A = None
        self.v: A = None
        self.y: A = None
        self.q: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: E = None
        self.q: F = None
        self.r: A = None
        self.x: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: A = None
        self.y: F = None
        self.p: C = None
        self.u: D = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: E = None
        self.q: F = None
        self.r: A = None
        self.x: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: A = None
        self.y: F = None
        self.p: C = None
        self.u: D = None
        self.txt = txt

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

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

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