class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: F = None
        self.t: F = None
        self.s: B = None
        self.o: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: G = None
        self.v: C = None
        self.t: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.w: C = None
        self.y: G = None
        self.z: G = None
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: A = None
        self.v: D = None
        self.z: C = None
        self.p: G = None
        self.txt = txt

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

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

n = A("n")
h = B("h")
b = C("b")
g = D("g")
f = E("f")
i = F("i")
c = G("c")
k = B("k")
l = B("l")
d = G("d")

n.r = g
n.v = i
n.t = i
n.s = h
n.o = f
h.q = f
h.p = c
h.v = b
h.t = n
b.t = k
b.r = i
b.o = i
b.q = f
b.w = g
g.t = c
g.y = c
g.w = b
g.z = d
g.s = n
f.q = c
f.r = n
f.v = g
f.z = b
f.p = d
i.o = d
c.x = i
k.q = f
k.p = c
k.v = b
k.t = n
l.q = f
l.p = d
l.v = b
l.t = n
d.x = i
assert h.q.r.s.q.p.x.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: F = None
        self.t: F = None
        self.s: B = None
        self.o: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: G = None
        self.v: C = None
        self.t: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.w: C = None
        self.y: G = None
        self.z: G = None
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: A = None
        self.v: D = None
        self.z: C = None
        self.p: G = None
        self.txt = txt

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

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

n = A("n")
h = B("h")
b = C("b")
g = D("g")
f = E("f")
i = F("i")
c = G("c")
k = B("k")
l = B("l")
d = G("d")

n.r = g
n.v = i
n.t = i
n.s = h
n.o = f
h.q = f
h.p = c
h.v = b
h.t = n
b.t = k
b.r = i
b.o = i
b.q = f
b.w = g
g.t = c
g.y = c
g.w = b
g.z = d
g.s = n
f.q = c
f.r = n
f.v = g
f.z = b
f.p = d
i.o = d
c.x = i
k.q = f
k.p = c
k.v = b
k.t = n
l.q = f
l.p = d
l.v = b
l.t = n
d.x = i
assert h.q.r.s.q.p.x.txt == "i"