class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: E = None
        self.y: E = None
        self.p: G = None
        self.s: B = None
        self.txt = txt

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

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

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

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

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

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

b = A("b")
e = B("e")
n = C("n")
k = D("k")
m = E("m")
h = F("h")
i = G("i")
c = D("c")

b.r = h
b.v = m
b.y = m
b.p = i
b.s = e
e.p = n
n.s = m
n.x = m
n.t = e
n.p = e
k.y = c
k.w = e
k.z = m
k.q = h
k.v = i
m.x = k
h.y = c
h.r = e
h.t = b
i.r = c
i.o = n
c.y = k
c.w = e
c.z = m
c.q = h
c.v = i
assert h.r.p.s.x.txt == "
class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: E = None
        self.y: E = None
        self.p: G = None
        self.s: B = None
        self.txt = txt

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

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

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

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

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

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

b = A("b")
e = B("e")
n = C("n")
k = D("k")
m = E("m")
h = F("h")
i = G("i")
c = D("c")

b.r = h
b.v = m
b.y = m
b.p = i
b.s = e
e.p = n
n.s = m
n.x = m
n.t = e
n.p = e
k.y = c
k.w = e
k.z = m
k.q = h
k.v = i
m.x = k
h.y = c
h.r = e
h.t = b
i.r = c
i.o = n
c.y = k
c.w = e
c.z = m
c.q = h
c.v = i
assert h.r.p.s.x.txt == "k"