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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.u: B = None
        self.x: F = None
        self.o: E = None
        self.q: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.u: B = None
        self.x: F = None
        self.o: E = None
        self.q: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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

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

b.v = e
j.y = n
m.v = j
m.u = j
m.q = j
m.x = e
m.o = f
i.p = b
f.q = g
e.z = g
g.q = f
n.v = e
c.v = j
c.u = j
c.q = j
c.x = e
c.o = g
assert e.z.q.q.q.txt == "f"