class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: A = None
        self.v: C = None
        self.q: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: E = None
        self.txt = txt

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

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

h = A("h")
b = B("b")
f = C("f")
a = D("a")
i = E("i")
c = F("c")

h.w = b
b.w = a
b.x = h
b.q = h
b.v = f
f.r = h
f.o = h
f.v = c
f.x = i
f.u = a
a.s = f
a.y = i
i.t = c
i.w = c
i.o = h
i.x = b
i.v = f
i.s = a
c.y = h
c.r = b
c.q = b
c.w = b
c.v = i
assert c.v.s.y.v.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: A = None
        self.v: C = None
        self.q: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: E = None
        self.txt = txt

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

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

h = A("h")
b = B("b")
f = C("f")
a = D("a")
i = E("i")
c = F("c")

h.w = b
b.w = a
b.x = h
b.q = h
b.v = f
f.r = h
f.o = h
f.v = c
f.x = i
f.u = a
a.s = f
a.y = i
i.t = c
i.w = c
i.o = h
i.x = b
i.v = f
i.s = a
c.y = h
c.r = b
c.q = b
c.w = b
c.v = i
assert c.v.s.y.v.txt == "f"