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

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

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

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

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

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

c = A("c")
m = B("m")
b = C("b")
l = D("l")
k = E("k")
f = F("f")
d = B("d")
a = A("a")
n = F("n")

c.u = f
c.p = f
c.t = l
c.x = k
c.y = n
m.t = b
m.r = b
m.u = c
m.p = f
m.w = l
b.z = l
b.q = k
b.u = a
l.p = d
l.t = n
k.s = m
f.o = b
d.t = b
d.r = b
d.u = c
d.p = f
d.w = l
a.u = f
a.p = f
a.y = f
a.t = l
a.x = k
n.o = b
assert f.o.u.x.s.t.q.txt == "
class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.p: F = None
        self.t: D = None
        self.x: E = None
        self.y: F = None
        self.txt = txt

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

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

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

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

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

c = A("c")
m = B("m")
b = C("b")
l = D("l")
k = E("k")
f = F("f")
d = B("d")
a = A("a")
n = F("n")

c.u = f
c.p = f
c.t = l
c.x = k
c.y = n
m.t = b
m.r = b
m.u = c
m.p = f
m.w = l
b.z = l
b.q = k
b.u = a
l.p = d
l.t = n
k.s = m
f.o = b
d.t = b
d.r = b
d.u = c
d.p = f
d.w = l
a.u = f
a.p = f
a.y = f
a.t = l
a.x = k
n.o = b
assert f.o.u.x.s.t.q.txt == "k"