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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

c = A("c")
f = B("f")
k = C("k")
l = D("l")
e = E("e")
m = F("m")
h = G("h")
j = D("j")

c.y = e
c.s = e
c.p = e
c.z = k
c.x = f
c.u = f
f.o = k
f.u = h
f.q = e
k.s = c
l.q = k
l.o = k
l.s = k
e.t = k
e.w = c
m.s = e
h.y = k
j.q = k
j.o = k
j.s = k
assert e.w.z.s.z.s.x.o.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: E = None
        self.p: E = None
        self.z: C = None
        self.x: B = None
        self.u: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

c = A("c")
f = B("f")
k = C("k")
l = D("l")
e = E("e")
m = F("m")
h = G("h")
j = D("j")

c.y = e
c.s = e
c.p = e
c.z = k
c.x = f
c.u = f
f.o = k
f.u = h
f.q = e
k.s = c
l.q = k
l.o = k
l.s = k
e.t = k
e.w = c
m.s = e
h.y = k
j.q = k
j.o = k
j.s = k
assert e.w.z.s.z.s.x.o.txt == "k"