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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: C = None
        self.u: D = None
        self.v: E = None
        self.p: C = None
        self.r: C = None
        self.w: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: G = None
        self.o: B = None
        self.s: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

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

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

d = A("d")
h = B("h")
b = C("b")
n = D("n")
f = E("f")
a = F("a")
k = G("k")
j = G("j")

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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: C = None
        self.u: D = None
        self.v: E = None
        self.p: C = None
        self.r: C = None
        self.w: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: G = None
        self.o: B = None
        self.s: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

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

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

d = A("d")
h = B("h")
b = C("b")
n = D("n")
f = E("f")
a = F("a")
k = G("k")
j = G("j")

d.s = h
d.t = h
h.y = b
h.s = b
h.p = b
h.r = b
h.u = n
h.v = f
h.w = a
b.v = n
b.r = k
b.o = h
b.s = f
n.w = d
f.u = d
f.s = d
f.r = h
f.w = b
a.r = j
a.y = j
a.q = h
a.s = k
k.x = n
k.t = h
k.q = h
k.v = a
k.o = f
k.r = j
j.x = n
j.t = h
j.q = h
j.v = a
j.o = f
j.r = k
assert h.v.w.s.w.r.txt == "k"