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

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

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

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.w: A = None
        self.q: C = None
        self.u: B = None
        self.s: A = None
        self.txt = txt

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

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

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

l = A("l")
d = B("d")
f = C("f")
e = D("e")
j = E("j")
k = F("k")
a = G("a")

l.r = k
l.q = d
l.v = j
d.x = j
d.v = j
d.r = e
d.s = a
d.w = k
f.x = k
f.p = k
e.y = a
e.w = l
e.s = l
e.q = f
e.u = d
j.s = l
j.w = f
j.v = d
j.x = k
k.z = l
k.w = l
k.t = a
a.r = k
a.v = f
a.o = f
a.w = e
a.s = l
assert k.t.o.p.t.s.txt == "
class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: B = None
        self.v: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.w: A = None
        self.q: C = None
        self.u: B = None
        self.s: A = None
        self.txt = txt

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

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

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

l = A("l")
d = B("d")
f = C("f")
e = D("e")
j = E("j")
k = F("k")
a = G("a")

l.r = k
l.q = d
l.v = j
d.x = j
d.v = j
d.r = e
d.s = a
d.w = k
f.x = k
f.p = k
e.y = a
e.w = l
e.s = l
e.q = f
e.u = d
j.s = l
j.w = f
j.v = d
j.x = k
k.z = l
k.w = l
k.t = a
a.r = k
a.v = f
a.o = f
a.w = e
a.s = l
assert k.t.o.p.t.s.txt == "l"