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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.y: G = None
        self.o: A = None
        self.r: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.x: G = None
        self.r: B = None
        self.y: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: A = None
        self.r: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.y: G = None
        self.o: A = None
        self.r: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.x: G = None
        self.r: B = None
        self.y: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: A = None
        self.r: B = None
        self.txt = txt

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

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

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