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

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

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

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: F = None
        self.q: G = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.p: F = None
        self.t: B = None
        self.r: A = None
        self.x: F = None
        self.o: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.r: E = None
        self.y: A = None
        self.q: E = None
        self.txt = txt

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

j = A("j")
g = B("g")
m = C("m")
e = D("e")
h = E("h")
a = F("a")
d = G("d")
l = A("l")

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: F = None
        self.q: G = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.p: F = None
        self.t: B = None
        self.r: A = None
        self.x: F = None
        self.o: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.r: E = None
        self.y: A = None
        self.q: E = None
        self.txt = txt

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

j = A("j")
g = B("g")
m = C("m")
e = D("e")
h = E("h")
a = F("a")
d = G("d")
l = A("l")

j.r = m
g.v = d
g.x = m
m.t = d
m.p = g
e.v = h
e.z = a
e.q = d
e.y = g
h.q = e
h.p = a
h.x = a
h.t = g
h.r = l
h.o = d
a.t = m
a.r = h
a.q = h
a.y = l
d.u = l
d.o = g
l.r = m
assert h.t.v.o.x.p.txt == "g"