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

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

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

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

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

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

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

c.u = a
c.p = a
c.t = m
c.r = h
i.z = c
i.w = c
i.v = c
h.r = a
h.z = i
h.x = i
h.y = i
h.q = l
h.s = l
m.r = c
a.x = m
a.r = c
a.w = c
a.s = l
a.y = l
a.t = i
l.w = h
l.x = c
l.t = a
assert m.r.r.r.t.w.p.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: D = None
        self.p: E = None
        self.r: C = None
        self.txt = txt

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

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

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

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

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

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

c.u = a
c.p = a
c.t = m
c.r = h
i.z = c
i.w = c
i.v = c
h.r = a
h.z = i
h.x = i
h.y = i
h.q = l
h.s = l
m.r = c
a.x = m
a.r = c
a.w = c
a.s = l
a.y = l
a.t = i
l.w = h
l.x = c
l.t = a
assert m.r.r.r.t.w.p.txt == "a"