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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.w: D = None
        self.q: G = None
        self.x: C = None
        self.z: D = None
        self.p: A = None
        self.s: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.w: D = None
        self.q: G = None
        self.x: C = None
        self.z: D = None
        self.p: A = None
        self.s: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: D = None
        self.txt = txt

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

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