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

class B:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.s: A = None
        self.u: A = None
        self.y: G = None
        self.p: D = None
        self.t: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.r: D = None
        self.s: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

c.r = f
c.x = i
c.y = h
c.p = h
c.w = d
c.t = l
c.u = b
h.v = l
d.v = l
d.s = c
d.u = c
d.y = b
d.p = f
d.t = i
f.q = k
n.z = f
n.r = f
n.s = d
i.o = d
i.x = d
b.w = n
l.z = h
j.z = f
j.r = f
j.s = d
k.z = f
k.r = f
k.s = d
assert b.w.z.q.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: F = None
        self.y: B = None
        self.w: C = None
        self.t: H = None
        self.p: B = None
        self.u: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.s: A = None
        self.u: A = None
        self.y: G = None
        self.p: D = None
        self.t: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.r: D = None
        self.s: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

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