class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.q: D = None
        self.t: F = None
        self.w: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.w: E = None
        self.r: F = None
        self.q: B = None
        self.v: B = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.w: E = None
        self.r: F = None
        self.q: B = None
        self.v: B = None
        self.txt = txt

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

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

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