class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: C = None
        self.p: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.u: D = None
        self.x: G = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.u: D = None
        self.x: G = None
        self.txt = txt

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

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

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

k.w = i
k.v = j
k.p = m
i.o = j
i.u = j
i.p = h
i.x = l
j.p = i
j.s = l
m.t = h
f.t = k
f.u = m
f.x = h
l.u = m
h.z = j
h.s = k
h.u = i
assert k.p.t.s.w.x.txt == "l"