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

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

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

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: A = None
        self.v: C = None
        self.x: A = None
        self.q: E = None
        self.r: A = 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.x: E = None
        self.q: D = None
        self.txt = txt

g = A("g")
j = B("j")
m = C("m")
a = D("a")
k = E("k")
f = F("f")
d = B("d")

g.y = k
g.r = m
g.t = m
g.x = m
g.u = f
j.s = f
j.z = k
j.y = d
m.s = k
m.v = j
a.z = m
a.v = m
a.y = g
a.x = g
a.r = g
a.q = k
k.o = g
f.x = k
f.q = a
d.s = f
d.z = k
d.y = j
assert a.v.s.o.u.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: C = None
        self.u: F = None
        self.t: C = None
        self.x: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: A = None
        self.v: C = None
        self.x: A = None
        self.q: E = None
        self.r: A = 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.x: E = None
        self.q: D = None
        self.txt = txt

g = A("g")
j = B("j")
m = C("m")
a = D("a")
k = E("k")
f = F("f")
d = B("d")

g.y = k
g.r = m
g.t = m
g.x = m
g.u = f
j.s = f
j.z = k
j.y = d
m.s = k
m.v = j
a.z = m
a.v = m
a.y = g
a.x = g
a.r = g
a.q = k
k.o = g
f.x = k
f.q = a
d.s = f
d.z = k
d.y = j
assert a.v.s.o.u.txt == "f"