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

class B:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: F = None
        self.r: C = None
        self.y: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.x: B = None
        self.z: B = None
        self.v: D = None
        self.p: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: F = None
        self.r: C = None
        self.y: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.x: B = None
        self.z: B = None
        self.v: D = None
        self.p: B = None
        self.txt = txt

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

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

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