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

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

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

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.o: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: D = None
        self.t: A = None
        self.q: G = None
        self.z: G = None
        self.txt = txt

e = A("e")
d = B("d")
n = C("n")
c = D("c")
i = E("i")
h = F("h")
f = G("f")
l = G("l")
b = B("b")
a = F("a")

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.o: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: D = None
        self.t: A = None
        self.q: G = None
        self.z: G = None
        self.txt = txt

e = A("e")
d = B("d")
n = C("n")
c = D("c")
i = E("i")
h = F("h")
f = G("f")
l = G("l")
b = B("b")
a = F("a")

e.x = n
d.q = i
n.r = b
n.x = a
c.t = h
c.o = h
i.z = n
i.v = h
i.q = d
i.y = c
i.o = b
h.z = n
h.r = n
h.v = e
h.o = e
f.v = c
f.r = c
f.t = e
f.q = l
f.z = l
l.v = c
l.r = c
l.t = e
l.q = f
l.z = f
b.q = i
a.z = n
a.r = n
a.v = e
a.o = e
assert c.t.o.x.r.q.v.v.x.x.txt == "a"