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

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

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

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

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

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

f = A("f")
h = B("h")
b = C("b")
m = D("m")
i = E("i")
d = F("d")

f.r = b
f.v = b
f.w = d
h.t = d
h.q = b
h.u = m
h.r = m
h.s = m
h.x = i
b.s = h
b.y = f
b.v = f
b.t = f
m.u = f
m.o = f
m.z = h
m.v = h
i.w = m
i.r = m
i.s = f
d.s = m
d.v = m
d.o = m
d.r = h
assert b.v.w.o.v.q.s.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: F = None
        self.v: C = None
        self.txt = txt

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

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

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

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

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

f = A("f")
h = B("h")
b = C("b")
m = D("m")
i = E("i")
d = F("d")

f.r = b
f.v = b
f.w = d
h.t = d
h.q = b
h.u = m
h.r = m
h.s = m
h.x = i
b.s = h
b.y = f
b.v = f
b.t = f
m.u = f
m.o = f
m.z = h
m.v = h
i.w = m
i.r = m
i.s = f
d.s = m
d.v = m
d.o = m
d.r = h
assert b.v.w.o.v.q.s.txt == "h"