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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: A = None
        self.y: A = None
        self.u: G = None
        self.w: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

f = A("f")
d = B("d")
i = C("i")
c = D("c")
k = E("k")
b = F("b")
g = G("g")
e = H("e")
j = G("j")
a = D("a")

f.r = b
d.t = f
d.q = f
d.y = f
d.s = g
d.x = g
d.u = i
i.x = j
c.s = j
c.q = a
c.x = k
c.t = k
k.t = f
k.q = f
k.y = f
k.u = j
k.w = e
b.t = i
b.r = f
b.x = f
b.w = g
b.v = c
g.t = d
g.r = b
g.q = a
e.p = j
j.t = d
j.r = b
j.q = a
a.s = g
a.q = c
a.x = k
a.t = k
assert b.x.r.v.x.txt == "
class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: A = None
        self.y: A = None
        self.u: G = None
        self.w: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

f = A("f")
d = B("d")
i = C("i")
c = D("c")
k = E("k")
b = F("b")
g = G("g")
e = H("e")
j = G("j")
a = D("a")

f.r = b
d.t = f
d.q = f
d.y = f
d.s = g
d.x = g
d.u = i
i.x = j
c.s = j
c.q = a
c.x = k
c.t = k
k.t = f
k.q = f
k.y = f
k.u = j
k.w = e
b.t = i
b.r = f
b.x = f
b.w = g
b.v = c
g.t = d
g.r = b
g.q = a
e.p = j
j.t = d
j.r = b
j.q = a
a.s = g
a.q = c
a.x = k
a.t = k
assert b.x.r.v.x.txt == "k"