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

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.s: G = None
        self.y: E = None
        self.p: E = None
        self.x: G = None
        self.u: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: H = None
        self.t: F = None
        self.u: G = None
        self.p: C = None
        self.y: A = None
        self.r: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: G = None
        self.r: C = None
        self.v: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.s: G = None
        self.y: E = None
        self.p: E = None
        self.x: G = None
        self.u: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: H = None
        self.t: F = None
        self.u: G = None
        self.p: C = None
        self.y: A = None
        self.r: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: G = None
        self.r: C = None
        self.v: D = None
        self.txt = txt

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

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