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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.w: D = None
        self.z: C = None
        self.y: F = None
        self.p: E = None
        self.o: E = None
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: G = None
        self.z: A = None
        self.x: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

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

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

f.q = e
f.p = e
f.s = n
e.v = c
e.p = c
e.o = c
e.w = g
e.z = l
e.q = l
e.y = k
l.w = e
l.o = n
l.z = f
l.x = c
g.z = k
c.y = l
k.x = c
k.s = l
k.p = g
n.x = c
n.s = f
m.x = c
m.s = l
m.p = g
assert l.z.q.q.x.y.o.x.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.s: G = None
        self.p: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.w: D = None
        self.z: C = None
        self.y: F = None
        self.p: E = None
        self.o: E = None
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: G = None
        self.z: A = None
        self.x: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

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

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

f.q = e
f.p = e
f.s = n
e.v = c
e.p = c
e.o = c
e.w = g
e.z = l
e.q = l
e.y = k
l.w = e
l.o = n
l.z = f
l.x = c
g.z = k
c.y = l
k.x = c
k.s = l
k.p = g
n.x = c
n.s = f
m.x = c
m.s = l
m.p = g
assert l.z.q.q.x.y.o.x.txt == "c"