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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.p: C = None
        self.w: F = None
        self.z: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: A = None
        self.v: A = None
        self.t: A = None
        self.x: F = None
        self.y: E = None
        self.u: D = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.p: C = None
        self.w: F = None
        self.z: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: A = None
        self.v: A = None
        self.t: A = None
        self.x: F = None
        self.y: E = None
        self.u: D = None
        self.txt = txt

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

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