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

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

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.p: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: D = None
        self.txt = txt

l = A("l")
k = B("k")
a = C("a")
e = D("e")
f = E("f")
h = F("h")
b = G("b")
g = B("g")
m = F("m")
c = F("c")

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

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

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.p: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: D = None
        self.txt = txt

l = A("l")
k = B("k")
a = C("a")
e = D("e")
f = E("f")
h = F("h")
b = G("b")
g = B("g")
m = F("m")
c = F("c")

l.o = e
l.r = e
l.q = f
l.y = m
l.p = b
k.o = b
a.u = b
a.p = g
e.z = b
e.w = b
e.s = l
e.t = l
e.o = g
e.q = k
f.x = g
f.s = m
h.r = a
h.w = e
h.u = l
h.v = l
h.t = g
h.z = b
b.o = l
b.r = e
g.o = b
m.r = a
m.w = e
m.u = l
m.v = l
m.t = g
m.z = b
c.r = a
c.w = e
c.u = l
c.v = l
c.t = g
c.z = b
assert a.u.o.p.txt == "b"