class A:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: A = None
        self.v: F = None
        self.u: F = None
        self.y: C = None
        self.r: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.y: D = None
        self.x: E = None
        self.q: E = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: E = None
        self.u: F = None
        self.s: F = None
        self.p: B = None
        self.txt = txt

i = A("i")
k = B("k")
g = C("g")
b = D("b")
d = E("d")
c = F("c")
a = G("a")
m = D("m")
l = E("l")

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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: A = None
        self.v: F = None
        self.u: F = None
        self.y: C = None
        self.r: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.y: D = None
        self.x: E = None
        self.q: E = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: E = None
        self.u: F = None
        self.s: F = None
        self.p: B = None
        self.txt = txt

i = A("i")
k = B("k")
g = C("g")
b = D("b")
d = E("d")
c = F("c")
a = G("a")
m = D("m")
l = E("l")

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