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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: A = None
        self.o: D = None
        self.q: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: B = None
        self.y: A = None
        self.u: B = None
        self.txt = txt

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

c = A("c")
k = B("k")
l = C("l")
f = D("f")
h = E("h")
a = F("a")

c.w = f
c.t = f
c.v = l
c.r = a
c.p = k
k.w = a
k.p = c
k.o = f
k.q = h
l.r = f
l.s = f
f.q = c
f.u = l
h.s = l
h.q = k
h.u = k
h.y = c
a.r = k
assert l.r.q.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: C = None
        self.r: F = None
        self.p: B = None
        self.t: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: A = None
        self.o: D = None
        self.q: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: B = None
        self.y: A = None
        self.u: B = None
        self.txt = txt

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

c = A("c")
k = B("k")
l = C("l")
f = D("f")
h = E("h")
a = F("a")

c.w = f
c.t = f
c.v = l
c.r = a
c.p = k
k.w = a
k.p = c
k.o = f
k.q = h
l.r = f
l.s = f
f.q = c
f.u = l
h.s = l
h.q = k
h.u = k
h.y = c
a.r = k
assert l.r.q.w.txt == "f"