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

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

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

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

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

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

h = A("h")
l = B("l")
m = C("m")
j = D("j")
f = E("f")
a = F("a")

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

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

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

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

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

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

h = A("h")
l = B("l")
m = C("m")
j = D("j")
f = E("f")
a = F("a")

h.w = l
h.t = j
h.s = a
h.o = a
h.z = a
l.r = h
l.u = j
m.p = h
m.q = l
j.w = m
j.y = a
f.t = m
f.s = m
f.x = a
f.p = h
f.u = j
a.z = f
assert h.w.u.w.q.r.o.txt == "a"