class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.o: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: G = None
        self.o: G = None
        self.v: G = None
        self.q: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.y: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: B = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: G = None
        self.o: G = None
        self.v: G = None
        self.q: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.y: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: B = None
        self.txt = txt

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

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

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

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