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

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

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: C = None
        self.txt = txt

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

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

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

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

c.o = m
c.q = h
e.x = i
h.o = d
h.x = i
h.p = c
d.y = c
d.u = h
a.x = d
a.o = d
a.u = c
a.r = i
a.z = i
m.w = h
m.x = e
m.t = i
i.x = e
i.t = e
i.v = a
assert c.o.t.v.u.o.x.x.txt == "i"