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

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

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

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: C = None
        self.w: A = None
        self.v: E = None
        self.y: C = None
        self.p: C = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: C = None
        self.w: A = None
        self.v: E = None
        self.y: C = None
        self.p: C = None
        self.txt = txt

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

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

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

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