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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

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

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

m.u = n
m.r = f
m.q = h
g.s = h
h.w = n
j.y = n
n.v = g
n.u = a
a.y = f
a.o = g
a.q = j
a.s = m
a.w = i
a.u = h
f.u = n
f.r = m
f.q = h
c.y = n
i.y = f
i.s = f
i.o = g
i.q = j
i.w = a
i.u = h
assert i.q.y.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.r: A = None
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

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

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

m.u = n
m.r = f
m.q = h
g.s = h
h.w = n
j.y = n
n.v = g
n.u = a
a.y = f
a.o = g
a.q = j
a.s = m
a.w = i
a.u = h
f.u = n
f.r = m
f.q = h
c.y = n
i.y = f
i.s = f
i.o = g
i.q = j
i.w = a
i.u = h
assert i.q.y.u.txt == "a"