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

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.z: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: A = None
        self.v: C = None
        self.txt = txt

m = A("m")
i = B("i")
l = C("l")
h = D("h")
g = E("g")
a = C("a")
j = C("j")
c = C("c")

m.r = g
m.y = g
m.w = c
i.p = j
i.t = g
l.o = g
l.z = m
h.t = a
g.w = j
g.v = j
g.z = m
a.o = g
a.z = m
j.o = g
j.z = m
c.o = g
c.z = m
assert i.p.o.v.o.z.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.y: E = None
        self.w: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.z: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: A = None
        self.v: C = None
        self.txt = txt

m = A("m")
i = B("i")
l = C("l")
h = D("h")
g = E("g")
a = C("a")
j = C("j")
c = C("c")

m.r = g
m.y = g
m.w = c
i.p = j
i.t = g
l.o = g
l.z = m
h.t = a
g.w = j
g.v = j
g.z = m
a.o = g
a.z = m
j.o = g
j.z = m
c.o = g
c.z = m
assert i.p.o.v.o.z.txt == "m"