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

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.t: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: G = None
        self.o: G = None
        self.z: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.w: A = None
        self.z: E = None
        self.x: G = None
        self.u: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.u: B = None
        self.z: B = None
        self.t: G = None
        self.v: B = None
        self.p: G = None
        self.txt = txt

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

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

j = A("j")
g = B("g")
e = C("e")
c = D("c")
h = E("h")
k = F("k")
n = G("n")

j.y = k
j.p = n
j.z = n
j.v = n
g.x = n
g.t = h
e.q = j
e.p = n
e.o = n
e.z = g
c.p = k
c.w = j
c.z = h
c.u = h
c.x = n
h.r = k
h.u = g
h.z = g
h.v = g
h.t = n
h.p = n
k.o = h
k.z = h
k.x = h
n.y = j
assert e.z.t.u.t.r.z.txt == "
class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.p: G = None
        self.z: G = None
        self.v: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.t: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: G = None
        self.o: G = None
        self.z: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.w: A = None
        self.z: E = None
        self.x: G = None
        self.u: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.u: B = None
        self.z: B = None
        self.t: G = None
        self.v: B = None
        self.p: G = None
        self.txt = txt

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

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

j = A("j")
g = B("g")
e = C("e")
c = D("c")
h = E("h")
k = F("k")
n = G("n")

j.y = k
j.p = n
j.z = n
j.v = n
g.x = n
g.t = h
e.q = j
e.p = n
e.o = n
e.z = g
c.p = k
c.w = j
c.z = h
c.u = h
c.x = n
h.r = k
h.u = g
h.z = g
h.v = g
h.t = n
h.p = n
k.o = h
k.z = h
k.x = h
n.y = j
assert e.z.t.u.t.r.z.txt == "h"