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

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

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.o: D = None
        self.y: B = None
        self.v: E = None
        self.z: D = None
        self.q: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.r: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.o: D = None
        self.y: B = None
        self.v: E = None
        self.z: D = None
        self.q: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.r: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

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

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