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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: B = None
        self.q: C = None
        self.txt = txt

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

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

g.x = i
g.u = b
j.p = e
j.w = e
h.y = j
h.v = j
n.y = b
n.o = j
n.r = i
n.u = i
n.x = i
n.q = g
a.y = h
a.q = h
a.u = j
i.w = g
b.w = g
e.y = h
e.q = h
e.u = j
assert n.y.w.x.w.u.w.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: B = None
        self.q: C = None
        self.txt = txt

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

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

g.x = i
g.u = b
j.p = e
j.w = e
h.y = j
h.v = j
n.y = b
n.o = j
n.r = i
n.u = i
n.x = i
n.q = g
a.y = h
a.q = h
a.u = j
i.w = g
b.w = g
e.y = h
e.q = h
e.u = j
assert n.y.w.x.w.u.w.x.txt == "i"