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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: G = None
        self.t: A = None
        self.o: E = None
        self.z: E = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.y: E = None
        self.x: E = None
        self.r: E = None
        self.s: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: E = None
        self.r: D = None
        self.txt = txt

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

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

g.p = i
g.q = l
b.r = g
b.t = g
b.s = c
b.o = a
b.z = a
b.u = a
i.q = c
i.y = a
i.x = a
i.r = a
i.s = g
f.u = c
f.w = i
f.o = b
a.u = i
a.z = i
a.q = b
a.s = c
a.r = g
l.z = f
l.r = f
l.o = a
c.z = g
assert c.z.q.z.u.z.q.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: G = None
        self.t: A = None
        self.o: E = None
        self.z: E = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.y: E = None
        self.x: E = None
        self.r: E = None
        self.s: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: E = None
        self.r: D = None
        self.txt = txt

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

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

g.p = i
g.q = l
b.r = g
b.t = g
b.s = c
b.o = a
b.z = a
b.u = a
i.q = c
i.y = a
i.x = a
i.r = a
i.s = g
f.u = c
f.w = i
f.o = b
a.u = i
a.z = i
a.q = b
a.s = c
a.r = g
l.z = f
l.r = f
l.o = a
c.z = g
assert c.z.q.z.u.z.q.txt == "l"