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

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: A = None
        self.t: D = None
        self.v: B = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: A = None
        self.t: D = None
        self.v: B = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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

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