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

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

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

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

e = A("e")
h = B("h")
c = C("c")
l = D("l")
n = A("n")
i = D("i")
j = A("j")
g = D("g")

e.x = c
e.o = c
e.u = h
e.w = l
h.v = c
h.p = e
h.r = l
h.w = l
c.r = i
c.w = e
l.x = c
l.r = c
n.x = c
n.o = c
n.u = h
n.w = l
i.x = c
i.r = c
j.x = c
j.o = c
j.u = h
j.w = g
g.x = c
g.r = c
assert n.o.w.w.r.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: B = None
        self.o: C = None
        self.w: D = None
        self.txt = txt

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

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

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

e = A("e")
h = B("h")
c = C("c")
l = D("l")
n = A("n")
i = D("i")
j = A("j")
g = D("g")

e.x = c
e.o = c
e.u = h
e.w = l
h.v = c
h.p = e
h.r = l
h.w = l
c.r = i
c.w = e
l.x = c
l.r = c
n.x = c
n.o = c
n.u = h
n.w = l
i.x = c
i.r = c
j.x = c
j.o = c
j.u = h
j.w = g
g.x = c
g.r = c
assert n.o.w.w.r.txt == "c"