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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: E = None
        self.p: D = None
        self.w: C = None
        self.txt = txt

g = A("g")
d = B("d")
a = C("a")
i = D("i")
c = E("c")
j = F("j")
e = D("e")

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: E = None
        self.p: D = None
        self.w: C = None
        self.txt = txt

g = A("g")
d = B("d")
a = C("a")
i = D("i")
c = E("c")
j = F("j")
e = D("e")

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