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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: E = None
        self.v: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: A = None
        self.y: A = None
        self.q: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: D = None
        self.u: C = None
        self.o: D = None
        self.w: F = None
        self.y: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: C = None
        self.x: E = None
        self.s: C = None
        self.z: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: E = None
        self.v: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: A = None
        self.y: A = None
        self.q: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: D = None
        self.u: C = None
        self.o: D = None
        self.w: F = None
        self.y: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: C = None
        self.x: E = None
        self.s: C = None
        self.z: F = None
        self.txt = txt

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

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