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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.w: A = None
        self.v: E = None
        self.p: C = None
        self.u: B = None
        self.o: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: F = None
        self.txt = txt

i = A("i")
e = B("e")
a = C("a")
b = D("b")
k = E("k")
j = F("j")
h = G("h")

i.o = a
e.w = j
e.z = a
a.x = h
b.w = i
b.x = i
b.s = k
k.s = h
j.x = h
j.w = i
j.v = k
j.p = a
j.u = e
j.o = b
h.y = i
h.p = j
assert k.s.p.x.y.o.x.y.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.w: A = None
        self.v: E = None
        self.p: C = None
        self.u: B = None
        self.o: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: F = None
        self.txt = txt

i = A("i")
e = B("e")
a = C("a")
b = D("b")
k = E("k")
j = F("j")
h = G("h")

i.o = a
e.w = j
e.z = a
a.x = h
b.w = i
b.x = i
b.s = k
k.s = h
j.x = h
j.w = i
j.v = k
j.p = a
j.u = e
j.o = b
h.y = i
h.p = j
assert k.s.p.x.y.o.x.y.txt == "i"