class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.p: D = None
        self.q: C = None
        self.s: E = None
        self.z: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.w: D = None
        self.x: A = None
        self.s: F = None
        self.u: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: A = None
        self.v: F = None
        self.p: B = None
        self.t: F = None
        self.txt = txt

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

e = A("e")
d = B("d")
k = C("k")
g = D("g")
l = E("l")
i = F("i")

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

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.w: D = None
        self.x: A = None
        self.s: F = None
        self.u: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: A = None
        self.v: F = None
        self.p: B = None
        self.t: F = None
        self.txt = txt

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

e = A("e")
d = B("d")
k = C("k")
g = D("g")
l = E("l")
i = F("i")

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