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

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.p: E = None
        self.q: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.t: C = None
        self.u: C = None
        self.v: C = None
        self.w: A = None
        self.x: C = None
        self.q: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.q: C = None
        self.z: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: F = None
        self.w: B = None
        self.q: C = None
        self.r: G = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.p: E = None
        self.q: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.t: C = None
        self.u: C = None
        self.v: C = None
        self.w: A = None
        self.x: C = None
        self.q: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.q: C = None
        self.z: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: F = None
        self.w: B = None
        self.q: C = None
        self.r: G = None
        self.txt = txt

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

i.r = h
i.w = c
i.x = k
i.s = k
h.w = j
d.x = i
g.y = k
g.p = c
g.q = i
c.u = g
c.p = l
k.s = i
k.w = i
k.t = d
k.u = d
k.v = d
k.x = d
k.q = j
j.p = k
j.q = d
j.z = g
l.x = g
l.t = k
l.w = h
l.q = d
l.r = j
a.w = j
e.u = g
e.p = l
assert d.x.x.w.r.w.p.txt == "k"