class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: B = None
        self.y: B = None
        self.p: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.p: F = None
        self.o: D = None
        self.w: B = None
        self.q: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.v: D = None
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: A = None
        self.o: A = None
        self.y: B = None
        self.s: A = None
        self.txt = txt

e = A("e")
n = B("n")
f = C("f")
k = D("k")
d = E("d")
g = F("g")
j = B("j")

e.s = j
e.z = j
e.y = n
e.p = d
n.z = d
n.w = d
n.r = d
n.y = g
n.x = g
n.q = e
f.s = k
f.o = k
f.p = g
f.q = g
f.w = j
k.r = d
k.t = e
k.x = g
d.x = n
d.v = k
d.t = j
g.v = n
g.y = n
g.q = e
g.o = e
g.s = e
j.z = d
j.w = d
j.r = d
j.y = g
j.x = g
j.q = e
assert d.v.r.t.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: B = None
        self.y: B = None
        self.p: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.p: F = None
        self.o: D = None
        self.w: B = None
        self.q: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.v: D = None
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: A = None
        self.o: A = None
        self.y: B = None
        self.s: A = None
        self.txt = txt

e = A("e")
n = B("n")
f = C("f")
k = D("k")
d = E("d")
g = F("g")
j = B("j")

e.s = j
e.z = j
e.y = n
e.p = d
n.z = d
n.w = d
n.r = d
n.y = g
n.x = g
n.q = e
f.s = k
f.o = k
f.p = g
f.q = g
f.w = j
k.r = d
k.t = e
k.x = g
d.x = n
d.v = k
d.t = j
g.v = n
g.y = n
g.q = e
g.o = e
g.s = e
j.z = d
j.w = d
j.r = d
j.y = g
j.x = g
j.q = e
assert d.v.r.t.txt == "j"