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

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

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

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

m = A("m")
e = B("e")
f = C("f")
i = D("i")
b = C("b")
c = B("c")
n = B("n")
h = A("h")
a = D("a")
j = A("j")

m.t = f
e.s = j
e.v = j
e.z = f
e.r = f
f.v = i
i.o = a
i.q = f
b.v = a
c.s = h
c.z = b
c.r = f
c.v = j
n.s = h
n.z = b
n.r = f
n.v = j
h.t = f
a.o = i
a.q = f
j.t = f
assert i.q.v.o.o.q.v.o.q.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

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

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

m = A("m")
e = B("e")
f = C("f")
i = D("i")
b = C("b")
c = B("c")
n = B("n")
h = A("h")
a = D("a")
j = A("j")

m.t = f
e.s = j
e.v = j
e.z = f
e.r = f
f.v = i
i.o = a
i.q = f
b.v = a
c.s = h
c.z = b
c.r = f
c.v = j
n.s = h
n.z = b
n.r = f
n.v = j
h.t = f
a.o = i
a.q = f
j.t = f
assert i.q.v.o.o.q.v.o.q.txt == "f"