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

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.u: H = None
        self.v: G = None
        self.o: E = None
        self.w: E = None
        self.z: B = None
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: B = None
        self.z: F = None
        self.v: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: F = None
        self.txt = txt

h = A("h")
i = B("i")
d = C("d")
g = D("g")
k = E("k")
f = F("f")
j = G("j")
c = H("c")

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

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.u: H = None
        self.v: G = None
        self.o: E = None
        self.w: E = None
        self.z: B = None
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: B = None
        self.z: F = None
        self.v: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: F = None
        self.txt = txt

h = A("h")
i = B("i")
d = C("d")
g = D("g")
k = E("k")
f = F("f")
j = G("j")
c = H("c")

h.w = i
h.s = i
h.p = k
h.q = k
i.w = d
d.p = i
d.z = i
d.u = c
d.v = j
d.o = k
d.w = k
d.x = h
g.v = f
k.w = f
k.x = g
k.s = c
k.v = i
f.r = d
j.r = i
j.x = i
j.z = f
j.v = k
c.t = h
c.s = f
assert k.w.r.u.s.txt == "f"