class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: E = None
        self.s: F = None
        self.x: E = None
        self.t: F = None
        self.y: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: D = None
        self.t: D = None
        self.x: D = None
        self.u: F = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: D = None
        self.t: D = None
        self.x: D = None
        self.u: F = None
        self.txt = txt

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

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

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

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

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

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