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

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

class C:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: F = None
        self.y: F = None
        self.o: A = None
        self.s: G = None
        self.t: G = None
        self.u: G = None
        self.txt = txt

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: F = None
        self.y: F = None
        self.o: A = None
        self.s: G = None
        self.t: G = None
        self.u: G = None
        self.txt = txt

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

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

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

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

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

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