class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.p: C = None
        self.y: A = None
        self.w: B = None
        self.x: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.t: C = None
        self.p: D = None
        self.w: E = None
        self.txt = txt

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

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

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

h = A("h")
n = B("n")
d = C("d")
l = D("l")
a = E("a")
b = A("b")
c = D("c")
j = C("j")
e = C("e")
f = D("f")

h.u = a
h.p = d
h.x = d
h.y = b
h.w = n
n.v = b
n.t = j
n.p = l
n.w = a
d.v = a
d.s = b
d.r = c
l.r = b
l.q = b
a.t = b
a.r = b
a.y = c
a.p = n
b.u = a
b.p = e
b.x = e
b.y = h
b.w = n
c.r = h
c.q = b
j.v = a
j.s = h
j.r = c
e.v = a
e.s = h
e.r = f
f.r = b
f.q = h
assert b.y.w.w.y.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.p: C = None
        self.y: A = None
        self.w: B = None
        self.x: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.t: C = None
        self.p: D = None
        self.w: E = None
        self.txt = txt

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

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

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

h = A("h")
n = B("n")
d = C("d")
l = D("l")
a = E("a")
b = A("b")
c = D("c")
j = C("j")
e = C("e")
f = D("f")

h.u = a
h.p = d
h.x = d
h.y = b
h.w = n
n.v = b
n.t = j
n.p = l
n.w = a
d.v = a
d.s = b
d.r = c
l.r = b
l.q = b
a.t = b
a.r = b
a.y = c
a.p = n
b.u = a
b.p = e
b.x = e
b.y = h
b.w = n
c.r = h
c.q = b
j.v = a
j.s = h
j.r = c
e.v = a
e.s = h
e.r = f
f.r = b
f.q = h
assert b.y.w.w.y.txt == "c"