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

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

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

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

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

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

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

i = A("i")
c = B("c")
h = C("h")
n = D("n")
b = E("b")
a = F("a")
d = G("d")

i.x = h
i.s = b
c.o = i
c.p = i
c.x = i
c.s = b
h.y = c
n.w = d
b.r = c
b.u = c
b.x = d
b.o = a
b.s = i
b.y = i
a.x = b
a.q = b
a.p = d
a.z = d
a.o = h
a.t = c
d.r = i
d.u = c
assert n.w.r.x.y.s.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

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

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

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

i = A("i")
c = B("c")
h = C("h")
n = D("n")
b = E("b")
a = F("a")
d = G("d")

i.x = h
i.s = b
c.o = i
c.p = i
c.x = i
c.s = b
h.y = c
n.w = d
b.r = c
b.u = c
b.x = d
b.o = a
b.s = i
b.y = i
a.x = b
a.q = b
a.p = d
a.z = d
a.o = h
a.t = c
d.r = i
d.u = c
assert n.w.r.x.y.s.txt == "b"