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

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

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: E = None
        self.q: A = None
        self.txt = txt

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

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

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

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

g.y = m
g.q = i
g.r = f
j.v = m
j.w = k
f.p = m
f.v = h
f.r = h
f.z = g
f.o = k
f.u = i
h.y = g
h.q = g
h.t = i
i.w = h
i.p = h
k.x = i
k.q = i
k.t = j
m.y = i
m.u = j
assert h.y.y.u.w.t.v.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: G = None
        self.q: E = None
        self.r: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: E = None
        self.q: A = None
        self.txt = txt

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

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

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

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

g.y = m
g.q = i
g.r = f
j.v = m
j.w = k
f.p = m
f.v = h
f.r = h
f.z = g
f.o = k
f.u = i
h.y = g
h.q = g
h.t = i
i.w = h
i.p = h
k.x = i
k.q = i
k.t = j
m.y = i
m.u = j
assert h.y.y.u.w.t.v.y.txt == "i"