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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: F = None
        self.z: E = None
        self.y: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: B = None
        self.w: F = None
        self.z: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: A = None
        self.x: D = None
        self.p: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: F = None
        self.z: E = None
        self.y: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: B = None
        self.w: F = None
        self.z: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: A = None
        self.x: D = None
        self.p: F = None
        self.txt = txt

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

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

f.u = n
f.q = a
f.s = a
i.p = f
i.s = n
i.z = m
i.y = l
d.p = i
l.s = m
l.u = d
l.r = k
l.x = n
m.u = i
m.y = i
m.w = a
m.z = d
n.w = l
n.x = l
n.t = f
n.p = a
j.z = d
j.u = i
j.p = m
j.r = a
k.u = i
k.y = i
k.w = a
k.z = d
a.w = l
a.x = l
a.t = f
a.p = n
assert j.u.y.s.w.txt == "a"