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

class B:
    def __init__(self, txt: str):
        self.s: A = 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: F = None
        self.txt = txt

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

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

i = A("i")
m = B("m")
g = C("g")
n = D("n")
d = E("d")
h = F("h")
e = F("e")
c = D("c")
j = F("j")

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

class B:
    def __init__(self, txt: str):
        self.s: A = 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: F = None
        self.txt = txt

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

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

i = A("i")
m = B("m")
g = C("g")
n = D("n")
d = E("d")
h = F("h")
e = F("e")
c = D("c")
j = F("j")

i.q = g
i.s = h
i.v = h
i.r = m
i.t = m
i.o = m
m.s = i
g.z = c
n.s = j
d.x = j
d.t = c
d.s = c
d.q = c
d.v = h
d.y = i
h.q = i
h.w = m
h.p = d
e.q = i
e.w = m
e.p = d
c.s = j
j.q = i
j.w = m
j.p = d
assert c.s.q.o.s.o.s.s.txt == "h"