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

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

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

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: C = None
        self.v: E = None
        self.txt = txt

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

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

f = A("f")
i = B("i")
e = C("e")
n = D("n")
h = E("h")
b = F("b")

f.s = i
f.t = i
f.z = b
f.w = n
f.v = h
f.x = h
i.s = n
i.u = b
e.s = n
e.x = i
e.y = i
e.w = b
e.r = h
n.r = h
n.v = h
n.q = e
h.y = f
h.v = e
h.r = i
b.s = e
b.r = h
b.z = i
assert b.z.s.q.w.r.v.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: F = None
        self.w: D = None
        self.v: E = None
        self.t: B = None
        self.x: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: C = None
        self.v: E = None
        self.txt = txt

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

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

f = A("f")
i = B("i")
e = C("e")
n = D("n")
h = E("h")
b = F("b")

f.s = i
f.t = i
f.z = b
f.w = n
f.v = h
f.x = h
i.s = n
i.u = b
e.s = n
e.x = i
e.y = i
e.w = b
e.r = h
n.r = h
n.v = h
n.q = e
h.y = f
h.v = e
h.r = i
b.s = e
b.r = h
b.z = i
assert b.z.s.q.w.r.v.txt == "e"