class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: B = None
        self.y: F = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: F = None
        self.p: C = None
        self.txt = txt

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

g.u = i
g.t = m
g.y = e
m.y = j
m.u = j
m.r = n
m.x = n
f.v = m
f.p = m
f.u = i
f.x = g
f.w = e
f.o = a
i.z = a
i.t = a
i.u = f
j.o = g
a.q = e
a.p = f
e.q = a
e.p = f
n.o = g
assert n.o.y.q.q.p.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: B = None
        self.y: F = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: F = None
        self.p: C = None
        self.txt = txt

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

g.u = i
g.t = m
g.y = e
m.y = j
m.u = j
m.r = n
m.x = n
f.v = m
f.p = m
f.u = i
f.x = g
f.w = e
f.o = a
i.z = a
i.t = a
i.u = f
j.o = g
a.q = e
a.p = f
e.q = a
e.p = f
n.o = g
assert n.o.y.q.q.p.u.txt == "i"