class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: G = None
        self.s: C = None
        self.p: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.q: D = None
        self.v: D = None
        self.w: B = None
        self.s: B = None
        self.r: C = None
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

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

f.q = l
f.o = a
f.s = i
f.p = i
l.w = c
l.r = c
l.v = c
l.z = f
l.p = f
l.u = a
i.p = c
i.v = a
m.r = l
m.x = a
m.w = a
m.v = f
m.s = i
m.t = j
m.p = j
c.x = a
c.q = m
c.v = m
c.w = l
c.s = l
c.t = l
c.r = i
j.p = l
a.p = j
assert f.s.p.x.p.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: G = None
        self.s: C = None
        self.p: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.q: D = None
        self.v: D = None
        self.w: B = None
        self.s: B = None
        self.r: C = None
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

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

f.q = l
f.o = a
f.s = i
f.p = i
l.w = c
l.r = c
l.v = c
l.z = f
l.p = f
l.u = a
i.p = c
i.v = a
m.r = l
m.x = a
m.w = a
m.v = f
m.s = i
m.t = j
m.p = j
c.x = a
c.q = m
c.v = m
c.w = l
c.s = l
c.t = l
c.r = i
j.p = l
a.p = j
assert f.s.p.x.p.txt == "j"