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

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

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

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

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

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

g = A("g")
h = B("h")
f = C("f")
l = D("l")
j = E("j")
k = F("k")
b = A("b")

g.s = j
g.p = l
h.u = k
h.o = l
h.r = b
f.o = j
f.u = j
l.s = j
j.o = f
j.p = f
j.v = f
j.y = l
j.u = g
j.z = h
k.x = f
k.u = h
b.s = j
b.p = l
assert l.s.z.o.s.y.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: D = None
        self.txt = txt

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

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

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

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

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

g = A("g")
h = B("h")
f = C("f")
l = D("l")
j = E("j")
k = F("k")
b = A("b")

g.s = j
g.p = l
h.u = k
h.o = l
h.r = b
f.o = j
f.u = j
l.s = j
j.o = f
j.p = f
j.v = f
j.y = l
j.u = g
j.z = h
k.x = f
k.u = h
b.s = j
b.p = l
assert l.s.z.o.s.y.txt == "l"