class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: B = None
        self.u: C = None
        self.q: C = None
        self.p: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: E = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: G = None
        self.x: F = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: E = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: G = None
        self.x: F = None
        self.txt = txt

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

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

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

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

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