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

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

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.u: C = None
        self.txt = txt

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

g = A("g")
a = B("a")
f = C("f")
b = D("b")
n = E("n")
h = F("h")
j = G("j")
c = D("c")
l = E("l")

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

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

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.u: C = None
        self.txt = txt

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

g = A("g")
a = B("a")
f = C("f")
b = D("b")
n = E("n")
h = F("h")
j = G("j")
c = D("c")
l = E("l")

g.z = h
g.t = f
a.v = f
f.z = j
b.p = c
b.q = a
b.x = g
b.z = f
b.o = l
n.r = h
n.y = h
n.u = a
h.r = j
h.u = f
j.w = c
j.x = g
j.q = h
j.p = h
j.o = a
j.z = a
c.p = b
c.q = a
c.x = g
c.z = f
c.o = n
l.r = h
l.y = h
l.u = a
assert h.u.z.z.v.z.x.z.r.z.txt == "a"