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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: G = None
        self.q: E = None
        self.s: A = None
        self.r: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: G = None
        self.q: E = None
        self.s: A = None
        self.r: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: E = None
        self.txt = txt

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

j.x = f
a.x = f
a.w = h
a.q = l
a.s = j
a.r = k
f.v = k
f.o = e
e.p = k
e.v = l
l.u = j
l.y = f
l.o = f
l.x = f
l.r = k
l.p = e
k.w = h
h.p = l
h.v = l
m.x = f
m.w = h
m.q = l
m.s = j
m.r = k
assert a.s.x.o.p.w.p.y.txt == "f"