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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.r: G = None
        self.y: D = None
        self.z: F = None
        self.u: A = None
        self.q: E = None
        self.x: C = None
        self.txt = txt

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

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

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

b.r = k
b.w = h
b.y = h
f.r = d
f.u = b
f.x = i
d.z = a
d.w = a
a.q = d
k.s = i
k.z = i
k.r = h
k.y = a
k.u = b
k.q = e
k.x = d
n.v = b
n.w = d
n.u = h
h.s = b
h.u = a
e.s = n
e.z = n
e.r = h
e.y = a
e.u = b
e.q = k
e.x = d
i.v = b
i.w = d
i.u = h
assert e.u.r.q.s.v.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: G = None
        self.y: G = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.r: G = None
        self.y: D = None
        self.z: F = None
        self.u: A = None
        self.q: E = None
        self.x: C = None
        self.txt = txt

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

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

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

b.r = k
b.w = h
b.y = h
f.r = d
f.u = b
f.x = i
d.z = a
d.w = a
a.q = d
k.s = i
k.z = i
k.r = h
k.y = a
k.u = b
k.q = e
k.x = d
n.v = b
n.w = d
n.u = h
h.s = b
h.u = a
e.s = n
e.z = n
e.r = h
e.y = a
e.u = b
e.q = k
e.x = d
i.v = b
i.w = d
i.u = h
assert e.u.r.q.s.v.r.txt == "k"