class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.y: C = None
        self.w: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: C = None
        self.v: A = None
        self.txt = txt

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

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

d = A("d")
g = B("g")
f = C("f")
a = D("a")
i = E("i")
c = F("c")
h = C("h")

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: C = None
        self.v: A = None
        self.txt = txt

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

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

d = A("d")
g = B("g")
f = C("f")
a = D("a")
i = E("i")
c = F("c")
h = C("h")

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