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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: B = None
        self.u: D = None
        self.x: D = None
        self.q: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: E = 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.w: F = None
        self.x: F = None
        self.z: B = None
        self.q: C = None
        self.txt = txt

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

d = A("d")
m = B("m")
g = C("g")
a = D("a")
n = E("n")
k = F("k")
j = B("j")
l = A("l")

d.y = n
d.x = k
d.s = a
d.w = l
m.v = k
m.q = k
m.p = j
m.u = a
m.x = a
g.r = l
g.x = n
a.y = k
n.w = k
n.x = k
n.z = m
n.q = g
k.u = a
k.r = l
k.v = l
j.v = k
j.q = k
j.p = m
j.u = a
j.x = a
l.y = n
l.x = k
l.s = a
l.w = d
assert m.q.u.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.x: F = None
        self.s: D = None
        self.w: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: B = None
        self.u: D = None
        self.x: D = None
        self.q: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: E = 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.w: F = None
        self.x: F = None
        self.z: B = None
        self.q: C = None
        self.txt = txt

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

d = A("d")
m = B("m")
g = C("g")
a = D("a")
n = E("n")
k = F("k")
j = B("j")
l = A("l")

d.y = n
d.x = k
d.s = a
d.w = l
m.v = k
m.q = k
m.p = j
m.u = a
m.x = a
g.r = l
g.x = n
a.y = k
n.w = k
n.x = k
n.z = m
n.q = g
k.u = a
k.r = l
k.v = l
j.v = k
j.q = k
j.p = m
j.u = a
j.x = a
l.y = n
l.x = k
l.s = a
l.w = d
assert m.q.u.y.txt == "k"