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

class B:
    def __init__(self, txt: str):
        self.y: H = None
        self.t: D = None
        self.q: G = None
        self.o: H = None
        self.w: D = None
        self.p: G = None
        self.r: C = None
        self.s: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.x: H = None
        self.q: B = None
        self.r: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: C = None
        self.t: E = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.s: F = None
        self.y: C = None
        self.q: E = None
        self.t: H = None
        self.v: E = None
        self.w: E = None
        self.r: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: H = None
        self.t: D = None
        self.q: G = None
        self.o: H = None
        self.w: D = None
        self.p: G = None
        self.r: C = None
        self.s: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.x: H = None
        self.q: B = None
        self.r: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: C = None
        self.t: E = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.s: F = None
        self.y: C = None
        self.q: E = None
        self.t: H = None
        self.v: E = None
        self.w: E = None
        self.r: B = None
        self.txt = txt

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

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