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

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

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

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

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

l = A("l")
g = B("g")
f = C("f")
i = D("i")
d = E("d")
h = F("h")
a = D("a")
b = B("b")
e = F("e")
c = B("c")

l.s = f
l.z = a
l.o = h
g.s = b
g.z = l
f.q = d
f.p = d
f.z = a
f.u = l
f.v = h
i.x = c
d.q = b
h.u = b
a.x = g
b.s = c
b.z = l
e.u = g
c.s = b
c.z = l
assert b.z.o.u.z.z.x.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: D = None
        self.o: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

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

l = A("l")
g = B("g")
f = C("f")
i = D("i")
d = E("d")
h = F("h")
a = D("a")
b = B("b")
e = F("e")
c = B("c")

l.s = f
l.z = a
l.o = h
g.s = b
g.z = l
f.q = d
f.p = d
f.z = a
f.u = l
f.v = h
i.x = c
d.q = b
h.u = b
a.x = g
b.s = c
b.z = l
e.u = g
c.s = b
c.z = l
assert b.z.o.u.z.z.x.s.s.txt == "c"