class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.o: G = None
        self.r: B = None
        self.s: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.v: G = None
        self.o: F = None
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.o: G = None
        self.r: B = None
        self.s: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.v: G = None
        self.o: F = None
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

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

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

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

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