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

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: D = None
        self.p: B = None
        self.v: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.u: E = None
        self.x: C = None
        self.q: C = None
        self.z: A = None
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: C = None
        self.o: E = None
        self.r: D = None
        self.p: D = None
        self.txt = txt

j = A("j")
k = B("k")
l = C("l")
n = D("n")
m = E("m")
f = F("f")
i = E("i")
c = B("c")
e = C("e")

j.p = n
k.u = f
k.z = n
k.p = c
k.v = m
l.u = m
l.r = c
n.p = f
n.u = i
n.w = i
n.x = e
n.q = l
n.z = j
m.s = i
m.z = f
f.w = n
f.r = n
f.p = n
f.u = l
f.o = m
i.s = m
i.z = f
c.u = f
c.z = n
c.p = k
c.v = i
e.u = m
e.r = c
assert l.u.z.o.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: D = None
        self.p: B = None
        self.v: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.u: E = None
        self.x: C = None
        self.q: C = None
        self.z: A = None
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: C = None
        self.o: E = None
        self.r: D = None
        self.p: D = None
        self.txt = txt

j = A("j")
k = B("k")
l = C("l")
n = D("n")
m = E("m")
f = F("f")
i = E("i")
c = B("c")
e = C("e")

j.p = n
k.u = f
k.z = n
k.p = c
k.v = m
l.u = m
l.r = c
n.p = f
n.u = i
n.w = i
n.x = e
n.q = l
n.z = j
m.s = i
m.z = f
f.w = n
f.r = n
f.p = n
f.u = l
f.o = m
i.s = m
i.z = f
c.u = f
c.z = n
c.p = k
c.v = i
e.u = m
e.r = c
assert l.u.z.o.txt == "m"