class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: E = None
        self.q: C = None
        self.w: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: E = None
        self.s: D = None
        self.p: C = None
        self.r: F = None
        self.x: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

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

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

e = A("e")
c = B("c")
b = C("b")
j = D("j")
l = E("l")
g = F("g")
h = G("h")

e.r = j
e.z = l
e.w = l
e.q = b
c.w = e
c.x = e
c.y = l
c.s = j
c.p = b
c.r = g
b.y = j
b.v = c
j.y = g
l.t = e
g.x = j
h.o = c
h.v = c
h.s = c
h.q = e
h.t = j
h.x = b
h.p = b
assert b.v.p.v.s.y.x.y.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: E = None
        self.q: C = None
        self.w: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: E = None
        self.s: D = None
        self.p: C = None
        self.r: F = None
        self.x: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

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

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

e = A("e")
c = B("c")
b = C("b")
j = D("j")
l = E("l")
g = F("g")
h = G("h")

e.r = j
e.z = l
e.w = l
e.q = b
c.w = e
c.x = e
c.y = l
c.s = j
c.p = b
c.r = g
b.y = j
b.v = c
j.y = g
l.t = e
g.x = j
h.o = c
h.v = c
h.s = c
h.q = e
h.t = j
h.x = b
h.p = b
assert b.v.p.v.s.y.x.y.txt == "g"