class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: B = None
        self.u: D = None
        self.x: C = None
        self.z: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.v: G = None
        self.w: B = None
        self.z: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

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

m.t = f
m.r = f
m.u = h
m.x = a
m.z = e
f.o = a
f.x = e
f.t = m
a.z = m
a.t = f
h.s = k
h.v = k
h.w = f
h.z = m
c.t = k
e.t = a
k.w = m
k.p = a
k.q = f
k.x = f
k.v = h
assert e.t.t.o.z.r.x.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: B = None
        self.u: D = None
        self.x: C = None
        self.z: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.v: G = None
        self.w: B = None
        self.z: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

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

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