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

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

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.u: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.p: E = None
        self.s: G = None
        self.w: A = None
        self.v: A = None
        self.txt = txt

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

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

f.y = n
f.z = i
f.q = d
f.u = m
j.z = i
n.q = j
d.v = j
d.u = b
k.y = j
k.p = b
k.w = d
k.v = n
b.t = e
b.p = k
b.s = i
b.w = f
b.v = f
i.r = f
i.v = k
i.w = k
m.t = e
m.s = e
m.p = k
m.w = f
m.v = f
e.r = f
e.v = k
e.w = k
assert k.p.s.r.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.z: G = None
        self.q: D = None
        self.u: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.u: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.p: E = None
        self.s: G = None
        self.w: A = None
        self.v: A = None
        self.txt = txt

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

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

f.y = n
f.z = i
f.q = d
f.u = m
j.z = i
n.q = j
d.v = j
d.u = b
k.y = j
k.p = b
k.w = d
k.v = n
b.t = e
b.p = k
b.s = i
b.w = f
b.v = f
i.r = f
i.v = k
i.w = k
m.t = e
m.s = e
m.p = k
m.w = f
m.v = f
e.r = f
e.v = k
e.w = k
assert k.p.s.r.txt == "f"