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

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.o: A = None
        self.y: F = None
        self.q: E = None
        self.txt = txt

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

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

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

h.t = a
g.u = k
e.u = h
e.q = h
a.v = e
a.u = j
a.z = c
j.u = c
j.y = c
j.o = h
j.q = d
c.r = l
k.t = h
k.v = h
k.q = a
k.r = c
k.x = g
l.t = h
l.v = h
l.q = a
l.r = c
l.x = g
d.u = c
d.y = c
d.o = h
d.q = j
assert d.o.t.u.q.q.y.r.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.o: A = None
        self.y: F = None
        self.q: E = None
        self.txt = txt

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

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

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

h.t = a
g.u = k
e.u = h
e.q = h
a.v = e
a.u = j
a.z = c
j.u = c
j.y = c
j.o = h
j.q = d
c.r = l
k.t = h
k.v = h
k.q = a
k.r = c
k.x = g
l.t = h
l.v = h
l.q = a
l.r = c
l.x = g
d.u = c
d.y = c
d.o = h
d.q = j
assert d.o.t.u.q.q.y.r.txt == "l"